<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
	</head>

	<body erke-hide>
	</body>
	<script>
	 /**
 * @param {string} paragraph
 * @param {string[]} banned
 * @return {string}
 */
var mostCommonWord = function(paragraph, banned) {
    var max=0;
    var obj={};
    var res;
    paragraph=paragraph.toLowerCase();
    paragraph=paragraph.replace(/[\|\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/g,"");
    paragraph=paragraph.split(' ');
    for(var i in paragraph){
    	if(!aAronDie(banned,paragraph[i])){
    		if(paragraph[i] in obj){
    			obj[paragraph[i]]++;
    		}else{
    			obj[paragraph[i]]=1;
    		};
    	};
    	if(obj[paragraph[i]]>max){
    		max=obj[paragraph[i]];
    		res=paragraph[i];
    	};
    };
    console.log(res);
    return res;
};
function aAronDie(arr,str){
	for(var i in arr){
		if(arr[i]==str){
			return true;
		};
	};
	return false;
};
res = new mostCommonWord("Bob hit a ball, the hit BALL flew far after it was hit.",["hit"]);
	</script>

</html>